// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name:   TxZJ.java

package com.tool.tcpimg;

import com.tool.image.ImageMixDeal;
import com.tool.tcp.GetTcpPath;
import com.tool.tcp.Sprite;
import com.tool.tcp.SpriteFactory;
import come.tool.Fighting.sidian;
import org.come.bean.PathPoint;
import org.come.until.Util;

import java.awt.*;
//飞行器
public class flywalktcp {
    private String skin;
    private int jg;
    private sidian sidians[];

    public flywalktcp(String skin) {
        this.skin = skin;
        sidians = new sidian[5];
        for (int i = 0; i < sidians.length; i++) {
            sidians[i] = new sidian(-1, 0, 0, 0);
        }

        jg = 30;
    }

    public void draw(Graphics g, long time) {
       {time = (long)((double)time/4);
            Sprite sprite = null;

            for (int i = 0; i < sidians.length; i++) {
                if (i == 0) {
                	sprite = SpriteFactory.Prepare(GetTcpPath.getflytcp(skin));
                }
                //shadowMode  
                GetTcpPath.getMouseTcp(skin);
                if (sidians[i].getX() != -1)  {
                    sidians[i].setX((int)((long)sidians[i].getX() + time));//
                    if (sprite != null) {
                        if (sidians[i].getX() <= sprite.getTime()) {
                            PathPoint pathPoint = Util.mapmodel.path(sidians[i].getZ(), sidians[i].getW());
                            if (pathPoint != null)
                            {
                                sprite.updateToTime(sidians[i].getX(), sidians[i].getY());
//                                sprite.drawfly(g, pathPoint.getX(), pathPoint.getY());
    //                            sprite.drawflyShadow(g, ImageMixDeal.userimg.getRoleShow().getX(), ImageMixDeal.userimg.getRoleShow().getY());
                            }
                        } else {
                            sidians[i].setX(-1);
                        }
                    }
                }
            }}
        return ;
    }
    
    public void addfly(int x, int y, int dir) {
        if (Util.mapmodel.path(x, y) == null) {
            return ;
        }
        for (int i = 0; i < sidians.length; i++) {
            jg--;
            if (jg < 0) {
                jg = 10;
                sidians[i].setsidian(0, dir, x, y);
            }
            return ;
        }
    }
    public void addshadow(int x, int y, int dir) {
    	if (Util.mapmodel.path(x, y) == null) {
    		sidians[0].setsidian(0, dir, x, y);
    		return ;
    	}
    }

    public void setSkin(String skin) {
        this.skin = skin;
    }
}
